@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    if (User.IsInRole("Administrator"))
    {
        <ul class="nav">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Administration<b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li>
                        @Html.ActionLink("Skills", "Index", "Skills", new { area = "Administration" }, null)
                    </li>
                    <li>
                        @Html.ActionLink("Users", "Index", "Users", new { area = "Administration" }, null)
                    </li>
                </ul>
            </li>

        </ul>
    }

    using (Html.BeginForm(
        "LogOff",
        "Account",
        new { area = "" },
        FormMethod.Post,
        new { id = "logoutForm", @class = "navbar-form pull-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav">
            <li>
                @Html.ActionLink("Live Chat", "Index", "LiveChat", new { area = "" }, null)
            </li>
            <li>
                @Html.ActionLink("Connections", "Index", "Connections", new { area = "" }, null)
            </li>
            <li>  
                @Html.Action("GetOwnPicture", "Profile", new { area = "" })
                @*@Html.ActionLink(
                    User.Identity.GetUserName(),
                    "Manage",
                    "Account",
                    routeValues: null,
                    htmlAttributes: new { title = "Manage your account!" })*@
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
        </ul>
    }
}
else
{
    <ul class="nav pull-right">
        <li>
            @Html.ActionLink(
                "Register",
                "Register",
                "Account",
                routeValues: new { area = "" },
                htmlAttributes: new { id = "registerLink" })
        </li>
        <li>
            @Html.ActionLink(
                "Log in", 
                "Login",
                "Account",
                routeValues: new { area = "" },
                htmlAttributes: new { id = "loginLink" })
        </li>
    </ul>
}